//
//  LYStatus.swift
//  Sina_Weibo2
//
//  Created by Elsevier on 16/5/20.
//  Copyright © 2016年 Yang Lu. All rights reserved.
//

import UIKit

class LYStatus: NSObject {
    ///微博创建时间
    var created_at:String?
    
    ///微博ID
    var id:Int64 = 0
    
    ///微博信息内容
    var text:String?
    
    ///微博来源
    var sourse:String?
    
    ///转发数
    var reposts_count:Int = 0
    
    ///评论数
    var comments_count:Int = 0
    
    ///表态数
    var attitudes_count:Int = 0
    
    ///微博配图
    var pic_urls:[[String:AnyObject]]?
    
    ///用户模型
    var user: LYUser?
    
    init(dict:[String:AnyObject]) {
        super.init()
        setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forKey key: String) {
        if key == "user"{
            if let dcit = value as? [String: AnyObject]{
                user = LYUser(dict:dcit)
            }
            
            return
        }
        super.setValue(value, forKey: key)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {}
        
    override var description:String{
        get{
            let keys = ["created_at","id","text","source","repost_count","comments_count","attitudes_count","pic_urls","user"]
        
            return "\n \t 微博模型: \(dictionaryWithValuesForKeys(keys))"
        }
    }
    
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
}
